﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoF23Learning._03.Builder_Pattern
{
    public class Car
    {
    	Dictionary<string,string> list;
    	
    	public Car(){
    		list = new Dictionary<string, string>();
    	}
    	
    	public  void BuildWheels(string wheels)
		{
    		list.Add("Wheels",wheels);
		}
		
		public  void BuildFrame(string frame)
		{
			 list.Add("Frame",frame);
		}
		
		public  void BuildEngine(string engine)
		{
			list.Add("Engine",engine); 
		}
		
		public  void BuildDoors(string doors)
		{
			list.Add("Doors",doors); 
		}
		
		public override string ToString()
		{
			StringBuilder result = new StringBuilder();
			foreach (var dic in list) {
				result.AppendFormat("{0}:{1}"+Environment.NewLine,dic.Key,dic.Value);
				
			}
			return result.ToString();
		}

    }
}
